import { mapState } from 'vuex'
export default {
    computed: {
        ...mapState([ 'loginerName' ])
    },
    watch: {
        '$route.name': function() {
            this.checkLogin()
        }
    },
    methods: {
        checkLogin() {
            if (!this.loginerName && this.$route.name !== 'login') {
                this.$router.push('/login')
            }
        }
    }
}